<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>

</head>

<body>
    <div id="ysh">
        <p>{{message}}</p>
        <p v-for="(item, index) in list">{{item}}</p>
        <span v-for="(item, index) in num"><button>新按钮</button></span>
        <hr>
        <button @click.once="add">点击加一行</button>
        <button @click="num++">点击加一个按钮</button>
    </div>
</body>
<script>

    var vm = new Vue({
        el: '#ysh',
        data: {

            list: [],
            message: '哈哈',
            num:0

        },
        methods: {
            add(value) {
                this.list.push('哈哈新一行')
            }
        },
    });
</script>

</html>